package com.qf.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class TestController {


    @Value("${server.port}")
    private Integer port;

    @GetMapping("/provider/test")
    public String test() throws InterruptedException {
        Thread.sleep(300);
        return "Provider Test！" + port;
    }


    @GetMapping("/provider/test1/{id}")
    public String test1(@PathVariable String id){
        return "接收到参数：" + id;
    }

    @GetMapping("/provider/test2")
    public String test2(String name,Integer age){
        return "接收到参数：" + name + "," + age;
    }

    @PostMapping("/provider/test3")
    public Map test3(@RequestBody Map map){
        return map;
    }
}
